package com.zyk.scaffold.tcp.disruptor;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

public class LocalThreadFactory implements ThreadFactory {

    private AtomicInteger index = new AtomicInteger(0);

    @Override
    public Thread newThread(Runnable r) {
        return new Thread(r, "disruptor - thread" + String.valueOf(index.incrementAndGet()));
    }

    public static LocalThreadFactory creatThreadFactory() {
        return new LocalThreadFactory();
    }
}
